#include <iostream>
#include <algorithm>
#include <map>

using namespace std;

typedef struct
{
    int value;
    int index;
} Node;

int main(int argc, char const *argv[])
{
    multimap<int, Node>::iterator p;
    multimap<int, Node> b;
    Node temp;
    int n, i, *a, key;
    
    cin >> n;
    
    a = new int[n];
    for (i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    
    sort(a, a + n);
    
    temp.index = 0;
    for (i = 0; i < n; i++)
    {
        cin >> temp.value;
        key = temp.value + a[temp.index];
        b.insert(make_pair(key, temp));
    }

    for (i = 0; i < n; i++)
    {
        p = b.begin();
        if (i) cout << " ";
        cout << (*p).first;
        temp = (*p).second;
        temp.index++;
        key = temp.value + a[temp.index];
        b.erase(p);
        b.insert(make_pair(key, temp));
    }
        
    return 0;
}
